<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/demo.css">
<script type="text/javascript" src="${pageContext.request.contextPath }/jq/jquery-3.2.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.easyui.min.js"></script>
<style type="text/css">
table
{
	background-color:BLUE;
}
td
{
	background-color:WHITE;
	padding:2px;
}
</style>
<script type="text/javascript">
$(function(){
	$(".select").each(function(i, e) {
        $.post("${pageContext.request.contextPath}/course/checkselect",
		{"course.id":e.lang},function(data){
			eval("e.checked="+data);
		});
    });
	
	$(".select").click(function(){
		$.post("${pageContext.request.contextPath}/course/checkit",
		{"course.id":this.lang});	
	});
});
</script>
</head>
<body>
<input type="hidden" id="page" value="${page }">

<div id="rw" class="easyui-window" title="Modal Window" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:500px;height:200px;padding:10px;">

</div>


<s:if test="#COURSES!=null">
<table>
<tr><td>序号</td><td>课程名称</td><td>课程类型</td><td>课程学时</td><td>授课教师</td><td>课室地址</td><td>选择</td></tr>
<s:iterator value="#COURSES" id="mycourse" status="st">
<tr><td>${st.index+1 }</td><td>${mycourse.name }</td><td>${mycourse.type }</td><td>${mycourse.hours }</td>
<td>${mycourse.teacher.name }</td>
<td>${mycourse.room.name }</td>
<td><input type="checkbox" class="select" lang="${mycourse.id }"></td>
</tr>
</s:iterator>
</table>
${NAVBAR}
</s:if>
<br>
<a href="${pageContext.request.contextPath }/main.jsp">返回主页面</a>

</body>
</html>